-- 传入的要操作的key:tokenKey
local limitCount = ARGV[1]
-- 传入的要操作的key:timestampKey
local limitPeriod = ARGV[2]
local c
c = redis.call('get', KEYS[1])
if c and tonumber(c) > tonumber(limitCount) then
    return c;
end
c = redis.call('incr', KEYS[1])
if tonumber(c) == 1 then
    redis.call('expire', KEYS[1], limitPeriod)
end
return c;